<tagLib name="html" />
{$header}
<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
  
<!--  功能组区域  -->
<div class="btn-toolbar">
      <div class="btn-group">
  <button class="btn btn-primary" onclick="addView()"><i class="icon-plus icon-white"></i> 新增</button>
<button class="btn btn-primary" onclick="edit()"><i class="icon-edit icon-white"></i> 编辑</button>
<button class="btn btn-primary" onclick="foreverdel()"><i class="icon-trash icon-white"></i> 删除</button>
</div>
<!-- 查询区域 -->
<form class="search-form pull-right" method='post' action="__URL__">
		<input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
		<php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php>
		<else/>
		placeholder="搜索"
	</notempty>
	>
	<input type="submit" class="btn btn-primary" value="搜索"></form>
</div>
<!-- 功能组区域结束 -->
<php>
    function getHouse($enter_id){
        return getModelName(getModelName($enter_id,'Back_supplier','warehouse_id'),'Warehouse');
    }
</php>
<!-- 列表显示区域  -->
<div class="list" >
  <notempty name="_REQUEST.back_supplier_id">
    <php>
      $eid = $_REQUEST['back_supplier_id'];
      $enter = M('Back_supplier');
      $enter->getById($eid);
      $total_number = M('Back_supplier_detail')->where('back_supplier_id = '.$eid)->sum('number');
      $enter_no = $enter->back_supplier_no;
      $total = $enter->total;
      $supplier = $enter->supplier_id;
      $user_id = $enter->user_id;
      $create_time = $enter->create_time;
    </php>
  <p class="h4 span12 alert-info alert"><strong>采购退货单号:</strong> {$enter_no}  <strong>总数量</strong>: {$total_number}  <strong>总金额：</strong>{$total}元   <strong>供应商:</strong>{$supplier|getModelName="Supplier"}    <strong>经办人：</strong>{$user_id|getModelName="User"}    <strong>退货时间:</strong>{$create_time|toDate}
  </p> 
  </notempty>
<div id="result" class="result none"></div><html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" show="id:编号|5%:edit,back_supplier_no:采购退货单号,product_id|getModelName=Product:产品,price:折价,number:数量,total:总金额,product_id|getDStock:当前库存,supplier_id|getModelName=Supplier:供应商,back_supplier_id|getHouse:仓库,create_time|toDate:创建时间,update_time|toDate:修改时间" actionlist="edit:详情:id" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>
<script type="text/javascript">
    function addView(){
        location.href='__APP__/Back_supplier/add';
    }
</script>

